package easy.爬楼梯;

/**
 * 爬楼梯
 *
 * @author CodeX
 * @since 2021-09-28 16:29:33
 */
public class ClimbStairs {
    public static int climbStairs(int n) {
        int x = 0, y = 0, z = 1;
        for (int i = 1; i <= n; i++) {
            x = y;
            y = z;
            z = x + y;
        }
        return z;
    }

    public static void main(String[] args) {
        System.out.println(climbStairs(5));
    }
}
